//
//  SFYDYViewController.m
//  GiftThat
//
//  Created by dllo on 16/1/18.
//  Copyright © 2016年 ChuXiang. All rights reserved.
//

#import "SFYDYViewController.h"

@interface SFYDYViewController ()
@property (nonatomic,retain) UIImageView *imageview ;
@end

@implementation SFYDYViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor orangeColor];
    [self initGuide]; //加载新用户指导页面
    
    
}
-(void)initGuide{
    UIScrollView *scrollview = [[UIScrollView alloc]initWithFrame:self.view.bounds];
    scrollview.bounces = NO;
    [scrollview setContentSize:CGSizeMake(self.view.width * 4, 0)];
    scrollview.pagingEnabled = YES;
    for (int i = 0; i < 4; i++) {
        self.imageview = [[UIImageView alloc]initWithFrame:CGRectMake(i * self.view.width, 0, self.view.width, self.view.height)];
        NSString *string = [NSString stringWithFormat:@"%d.jpg",i];
        self.imageview.image = [UIImage imageNamed:string];
        [scrollview addSubview:self.imageview];
        if (i == 3) {
            UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
            button.frame = CGRectMake( self.view.width / 2 -100, self.view.height - 80, 200, 50);
            
            [button setTitle:@"Enter GiftWord" forState:UIControlStateNormal];
            [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
            [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
            [button addTarget:self action:@selector(ButtonDidPress:) forControlEvents:UIControlEventTouchUpInside];
            [self.imageview addSubview:button];
        }
        
        
        self.imageview.userInteractionEnabled = YES;
    }
    [scrollview addSubview:self.imageview];
    [self.view addSubview:scrollview];
    
    
}
-(void)ButtonDidPress:(UIButton *)sender{
    [self.delegate ChooseVC];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
